//
//  CUserPageCtrl.h
//  HCHK_iphone
//
//  Created by yilong zhang on 11-12-19.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "CRootCtrlManager.h"
#import "AppConfig.h"
#import "CUser.h"
#import "CLoginView.h"
#import "CTopBarView.h"
#import "CAttentionView.h"
#import "CAttentionDataView.h"
#import "CRegisterView.h"
#import "CInfoView.h"
#import "COptionView.h"
#import "CFriendListView.h"
#import "CAttentionDetail.h"
#import "CForgetPwd.h"

@class CMyInfoView;
@class CLoginView;
@class CInfoView;
@class CRegisterView;
@class COptionView;
@class CFriendListView;
@class CAttentionDataView;
@class CAttentionDetail;
@class CForgetPwd;

@protocol OptionViewDelegate;
@protocol InfoViewDelegate;

@interface CUserPageCtrl : UIViewController <TopBarDelegate, OptionViewDelegate, InfoViewDelegate, AttentionViewDelegate>

//topbar
@property (nonatomic, assign) CTopBarView       *m_TopBar;
@property (nonatomic, assign) UILabel           *m_Title;
@property (nonatomic, assign) UIButton          *m_LogoutBtn;
@property (nonatomic, assign) UIButton          *m_BackBtn;
@property (nonatomic, assign) UIButton          *m_OptionBtn;
@property (nonatomic, assign) UIButton          *m_LoginBtn;
@property (nonatomic, assign) UIButton          *m_RegBtn;
@property (nonatomic, assign) int               m_nIndex;
@property (nonatomic, assign) CLoginView        *m_LoginView;
@property (nonatomic, assign) CRegisterView     *m_RestisterView;
@property (nonatomic, retain) NSString          *m_sUserIconUrl;
@property (nonatomic, assign) CInfoView         *m_MyFoodView;
@property (nonatomic, assign) COptionView       *m_OptionView;
@property (nonatomic, assign) CFriendListView   *m_FriendsLst;
@property (nonatomic, assign) CAttentionView    *m_AttentionView;
@property (nonatomic, assign) CAttentionDataView*m_AttentionData;
@property (nonatomic, assign) CAttentionDetail  *m_AttentionDetail;
@property (nonatomic, assign) CMyInfoView       *m_InfoView;
@property (nonatomic, assign) CForgetPwd        *m_ForgetView;

+(CUserPageCtrl*)DefaultUserPage;
+(void)DestroyUserPage;

-(void)DidReturnDown;
-(void)SetUserPageInfo;

//topbar
-(void)SetUpTopBar;
-(void)OnTopBarDown:(UIButton*)sender;
-(void)OnTopBarBackBtnDown:(UIButton*)sender;
-(void)SetTopBarTitle:(NSString*)image Title:(NSString*)title;

//self
-(void)ShowOptionPageCtrl;
-(void)DidOptionPageCtrlShown;
-(void)HiddenOptionPageCtrl;
-(void)UserPageHidden;

//注册成功
-(void)DidRegisterSuccessed;
-(void)DidRgBtnClicked:(NSNumber*)number Value:(id)value;
-(void)UploadIconReponse:(NSNotification*)notification;
-(void)RegisterReponse:(NSNotification*)notification;
-(void)ShowRegisterView;
-(void)HiddenRegisterView;

//login
-(void)CommitLoginRequest;
-(void)LoginResponse:(NSNotification*)notification;
-(void)DidLoginBtnClicked:(NSNumber*)number Value:(id)value;
-(void)ShowLoginView;
-(void)HiddenLoginView;

//forgetpwd
-(void)DidForgerPwdBtnClicked:(NSNumber*)number Value:(id)value;
-(void)ShowForgetView;
-(void)HiddenForgetView;

//logout
-(void)CommitLogoutRequest;
-(void)LogoutResponse:(NSNotification*)notification;

//find password
-(void)CommitFindPwdRequest:(NSString*)email;
-(void)FindPwdResponse:(NSNotification*)notification;

//my info
-(void)DidMyInfoViewShown;
-(void)ShowMyInfoView:(BOOL)banimation;
-(void)DidInfoViewHidden;
-(void)HiddenInfoView;

//option view
-(void)ShowOptionView;
-(void)HiddenOptionView;

//friends list
-(void)ShowFriendsList;
-(void)DidFriendsListShown;
-(void)HiddenFriendsList;
-(void)DidFriendsListHidden;

//attention view
-(void)ShowAttentionView;
-(void)DidAttentionShown;
-(void)HiddenAttentionView;
-(void)DidAttentionHidden;

//attention data
-(void)ShowAttentionData:(NSString*)title;
-(void)DidAttentionDataShown;
-(void)HiddenAttentionData;
-(void)DidAttentionDataHidden;

//attention detail
-(void)ShowAttentionDetail:(NSString*)title;
-(void)DidAttentionDetailShown;
-(void)HiddenAttentionDetail;
-(void)DidAttentionDetailHidden;

//request
-(void)UpdateUIWhenRequestError:(id)object;
-(void)UpdateUIWhenRequestTimeout:(id)object;

@end
